package com.ss.android.topic.e.a;

import com.bytedance.retrofit2.Callback;
import com.bytedance.retrofit2.ResponseWrapper;
import com.ss.android.article.base.utils.JSONObjectWrapper;

final class b implements Callback {
    private final a b;
    private final Callback a;

    b(a arg1, Callback arg2) {
        this.b = arg1;
        this.a = arg2;

    }

    public final void onCacheResponse(ResponseWrapper response) {
        ResponseWrapper v0 = ResponseWrapper.createResponseWrapper(this.b.a(response.body), response.rawResponse);
        if(this.a != null) {
            this.a.onCacheResponse(v0);
        }
    }

    public final void onErrorResponse(Throwable throwable) {
        new JSONObjectWrapper().put("error_detail", throwable.getMessage());
        if(this.a != null) {
            this.a.onErrorResponse(throwable);
        }
    }
}

